#include <bits/stdc++.h>
using namespace std;


class Solution
{
public:
    vector<int> tmp;
    vector<vector<int>> ans;
    int n;
    void dfs(int x, vector<int>& nums)
    {
        if (x == n)
        {
            ans.emplace_back(tmp);
            return;
        }
        //选
        tmp.emplace_back(nums[x]);
        dfs(x + 1, nums);
        tmp.pop_back();
        //不选
        dfs(x + 1, nums);
    }
    vector<vector<int>> subsets(vector<int>& nums)
    {
        n = nums.size();
        dfs(0, nums);
        return ans;
    }
};
